package cn.py.boot_lua.pattern.mediator;

// 客户端代码
public class Client {
    public static void main(String[] args) {
        ConcreteMediator mediator = new ConcreteMediator();

        ComponentA componentA = new ComponentA(mediator);
        ComponentB componentB = new ComponentB(mediator);

        mediator.setComponentA(componentA);
        mediator.setComponentB(componentB);

        componentA.triggerEvent("Event A");
        componentB.handleEvent("Event B");
    }
}
